package com.dslcode.cloud.shop.api.controller;

import com.dslcode.cloud.common.api.member.MemberAPI;
import com.dslcode.cloud.common.model.member.Member;
import com.dslcode.cloud.common.utils.AjaxResponse;
import com.dslcode.cloud.shop.api.feign.MemberProviderFeign;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by dongsilin on 2017/10/9.
 */
@Slf4j
@RestController
public class MemberController implements MemberAPI{

    @Autowired
    private MemberProviderFeign memberProviderFeign;

    @Override
    public AjaxResponse<PageInfo<Member>> list(@RequestParam(name = "pageNum", defaultValue = "1") int pageNum, @RequestParam(name = "pageSize", defaultValue = "10") int pageSize) {
        return null;
    }

    @Override
    public AjaxResponse detail(@PathVariable(name = "id") Long id){
        return memberProviderFeign.detail(id);
    }

    @Override
    public AjaxResponse addPoints(@PathVariable(name = "id") Long id, int points) {
        return null;
    }

}
